-
Notifications
You must be signed in to change notification settings - Fork 15
feat: [Orchestration] Convenience for response format #341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
orchestration/src/main/java/com/sap/ai/sdk/orchestration/OrchestrationModuleConfig.java
Outdated
Show resolved
Hide resolved
orchestration/src/main/java/com/sap/ai/sdk/orchestration/OrchestrationModuleConfig.java
Outdated
Show resolved
Hide resolved
orchestration/src/main/java/com/sap/ai/sdk/orchestration/OrchestrationModuleConfig.java
Outdated
Show resolved
Hide resolved
orchestration/src/main/java/com/sap/ai/sdk/orchestration/OrchestrationModuleConfig.java
Show resolved
Hide resolved
CharlesDuboisSAP
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comments
sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/OrchestrationTest.java
Show resolved
Hide resolved
sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/OrchestrationService.java
Outdated
Show resolved
Hide resolved
orchestration/src/test/java/com/sap/ai/sdk/orchestration/OrchestrationModuleConfigTest.java
Outdated
Show resolved
Hide resolved
orchestration/src/main/java/com/sap/ai/sdk/orchestration/OrchestrationModuleConfig.java
Outdated
Show resolved
Hide resolved
…strationModuleConfig.java Co-authored-by: Charles Dubois <[email protected]>
…ch-schema-convenience
| */ | ||
| @Tolerate | ||
| @Nonnull | ||
| @Beta |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added @Beta annotations to every new convenience method/class.
orchestration/src/main/java/com/sap/ai/sdk/orchestration/OrchestrationModuleConfig.java
Outdated
Show resolved
Hide resolved
| @Value | ||
| @AllArgsConstructor(access = AccessLevel.PROTECTED) | ||
| @Beta | ||
| public class OrchestrationTemplateReference extends TemplateConfig { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not add tests for this class in OrchestrationUnitTests since this is part of BLI 184
orchestration/src/main/java/com/sap/ai/sdk/orchestration/OrchestrationModuleConfig.java
Outdated
Show resolved
Hide resolved
orchestration/src/main/java/com/sap/ai/sdk/orchestration/OrchestrationTemplate.java
Outdated
Show resolved
Hide resolved
orchestration/src/main/java/com/sap/ai/sdk/orchestration/OrchestrationTemplate.java
Outdated
Show resolved
Hide resolved
orchestration/src/main/java/com/sap/ai/sdk/orchestration/ResponseJsonSchema.java
Outdated
Show resolved
Hide resolved
orchestration/src/main/java/com/sap/ai/sdk/orchestration/ResponseJsonSchema.java
Show resolved
Hide resolved
orchestration/src/main/java/com/sap/ai/sdk/orchestration/ResponseJsonSchema.java
Outdated
Show resolved
Hide resolved
orchestration/src/main/java/com/sap/ai/sdk/orchestration/TemplateConfig.java
Outdated
Show resolved
Hide resolved
…nseJsonSchema.java Co-authored-by: Alexander Dümont <[email protected]>
orchestration/src/main/java/com/sap/ai/sdk/orchestration/OrchestrationTemplateReference.java
Show resolved
Hide resolved
Co-authored-by: Alexander Dümont <[email protected]> Co-authored-by: Jonas-Isr <[email protected]>
orchestration/src/main/java/com/sap/ai/sdk/orchestration/ResponseJsonSchema.java
Outdated
Show resolved
Hide resolved
newtork
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Context
AI/ai-sdk-java-backlog#195.
This PR adds convenience methods to set the response format in Orchestration. A JSON schema can be created from a class and then used as a response schema as follows:
If only any JSON response is wanted, without strict adherence to a given schema, the user can use
var configWithJsonResponse = config.withTemplateConfig(TemplateConfig.create().withJsonResponse()).Feature scope:
ResponseJsonSchemaTemplateConfig,OrchestrationTemplate, andOrchestrationTemplateReferenceTemplateConfigDefinition of Done
Aligned changes with the JavaScript SDK